package com.project.harmonyledger.common.exception;

import com.project.harmonyledger.common.response.Result;
import com.project.harmonyledger.common.response.ResultCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

  @ExceptionHandler(Exception.class)
  public Result<String> handleException(Exception e) {
    return Result.error(ResultCode.SYSTEM_ERROR, e.getMessage());
  }
}